import request from '@/pages/api/index.js'; // 封装的request.js文件的位置

// 获取用户基本信息
/* export const getBaseInfo = () => {
	return request(`/user/basicInfo`, 'GET')
} */

// 获取用户基本信息 参数拼接在路径
export const getBaseInfo = (userId) => {
	return request('/scanorder/shopspeedRmsCatelist/list', 'GET',userId)
}

/* // 获取用户基本信息 restful风格
export const getBaseInfo = (userId) => {
	return request(`/user/basicInfo/userId`, 'GET')
}
 */
// 获取公匙
export const getPubKey = (loading = true) => {
	return request(`/user/getPubKey`, 'GET', null, loading)
}

// 工厂列表
export const getStoreList = (data) => {
    return request(`/system/store/list`,'GET',data,false)
}
// 工厂分页
export const getStorePageList = (data) => {
    return request(`/system/store/page`,'GET',data,false)
}

export const updateUserByStoreId = (data) => {
    return request(`/system/user/updateUserByStoreId`,'PUT',data,false)
}

// 尺码管理  查询
export const getSizeManager = (data) => {
	return request(`/system/size/page`, 'GET', data, false)
}

// 尺码管理  查询
export const getSizeManagerList = (data) => {
    return request(`/system/size/list`, 'GET', data, false)
}

// 尺码管理 新增
export const addSizeManager = (data) => {
	return request(`/system/size`, 'POST', data, false)
}
// 尺码管理 修改
export const updateSizeManager = (data) => {
	return request(`/system/size`, 'PUT', data, false)
}
// 尺码管理 删除
export const deleteSizeManager = (data) => {
	return request(`/system/size/`+data, 'DELETE', null, false)
}

// 工序模板 分页查询
export const getProcessTemplateManager = (data) => {
    return request(`/system/process/template/pageList`, 'GET', data, false)
}

// 工序模板 list查询
export const getProcessTemplateList = (data) => {
    return request(`/system/process/template/list`, 'GET', data, false)
}

// 工序模板 新增
export const addProcessTemplateManager = (data) => {
    return request(`/system/process/template`, 'POST', data, false)
}


// 工序模板 修改
export const updateProcessTemplateManager = (data) => {
    return request(`/system/process/template`, 'PUT', data, false)
}
//

// 工序模板 删除
export const deleteProcessTemplateManager = (data) => {
    return request(`/system/process/template/`+data, 'DELETE', null, false)
}


// 工序 分页查询
export const getProcessManager = (data) => {
	return request(`/system/process/pageList`, 'GET', data, false)
}

// 工序 list查询
export const getProcessList = (data) => {
    return request(`/system/process/list`, 'GET', data, false)
}

// 工序模板 新增
export const addProcessManager = (data) => {
	return request(`/system/process`, 'POST', data, false)
}


 // 工序模板 修改
 export const updateProcessManager = (data) => {
 	return request(`/system/process`, 'PUT', data, false)
 }
 //

 // 工序模板 删除
 export const deleteProcessManager = (data) => {
 	return request(`/system/process/`+data, 'DELETE', null, false)
 }

// 颜色分组 查询
export const getColorGroup = (data) => {
    return request(`/system/color/group/page`, 'GET', data, false)
}

// 颜色分组 查询
export const getColorGroupList = (data) => {
    return request(`/system/color/group/list`, 'GET', data, false)
}

// 颜色分组 新增
export const addColorGroup = (data) => {
    return request(`/system/color/group`, 'POST', data, false)
}

// 颜色分组 修改
export const updateColorGroup = (data) => {
    return request(`/system/color/group`, 'PUT', data, false)
}
// 颜色分组 删除
export const deleteColorGroup = (data) => {
    return request(`/system/color/group/`+data, 'DELETE', null, false)
}

 // 颜色管理 查询
 export const getColorManager = (data) => {
 	return request(`/system/color/page`, 'GET', data, false)
 }

 // 颜色管理 查询
 export const getColorManagerList = (data) => {
     return request(`/system/color/list`, 'GET', data, false)
 }

 // 颜色管理 新增
 export const addColorManager = (data) => {
 	return request(`/system/color`, 'POST', data, false)
 }

  // 颜色管理 修改
 export const updateColorManager = (data) => {
    return request(`/system/color`, 'PUT', data, false)
 }
 // 颜色管理 删除
 export const deleteColorManager = (data) => {
 	return request(`/system/color/`+data, 'DELETE', null, false)
 }


// 登录接口
export const login = (user) => {
	return request('/app/login', 'POST', user)
}

// 登录接口(微信一键登录)
export const loginWechat = (user) => {
	return request('/app/wxLogin', 'POST', user)
}

// 基本信息

export const getInfo = (user) => {
	return request('/app/getInfo', 'GET', user)
}


// 修改密码

export const updatePwd = (user) => {
	return request('/system/user/profile/updatePwd?oldPassword='+user.oldPassword +'&newPassword='+user.newPassword, 'PUT', null)
}



 // 款式管理 查询
 export const getNumberManager = (data) => {
 	return request(`/system/number/list`, 'GET', data, false)
 }

 // 款式管理 一个
 export const getNumberOneManager = (data) => {
     return request(`/system/number/`+data, 'GET', null, false)
 }

 // 款式管理 新增
 export const addNumberManager = (data) => {
 	return request(`/system/number`, 'POST', data, false)
 }


  // 款式管理 修改
  export const updateNumberManager = (data) => {
  	return request(`/system/number`, 'PUT', data, false)
  }
 // 款式管理 删除
 export const deleteNumberManager = (data) => {
 	return request(`/system/number/`+data, 'DELETE', null, false)
 }


 // 员工管理 查询
 export const getUserManager = (data) => {
 	return request(`/system/user/list`, 'GET', data, false)
 }

 // 员工管理 新增
 export const addUserManager = (data) => {
 	return request(`/system/user`, 'POST', data, false)
 }


  // 员工管理 修改
  export const updateUserManager = (data) => {
  	return request(`/system/user/addAndupdateByApp`, 'PUT', data, false)
  }
 // 员工管理 删除
 export const deleteUserManager = (data) => {
 	return request(`/system/user/`+data, 'DELETE', null, false)
 }

 // 员工状态修改(离职/在职)
 export const changeStatusUserManager = (data) => {
 	return request(`/system/user/changeStatus`, 'PUT', data, false)
 }

 export const syncUserCheckDev = (data) => {
    return request(`/system/userCheckDev`,'GET',data,false)
 }


 // 员工薪资 查询
 export const getSalarManager = (data) => {
 	return request(`/system/salary/list`, 'GET', data, false)
 }

 export const getSalartInfo = (data) => {
    return request(`/system/salary/getInfoByApp/`+data,'GET', null, false)
 }

 // 员工薪资 新增
 export const addSalarManager = (data) => {
 	return request(`/system/salary`, 'POST', data, false)
 }


  // 员工薪资 修改
  export const updateSalarManager = (data) => {
  	return request(`/system/salary`, 'PUT', data, false)
  }
 // 员工薪资 删除
 export const deleteSalaryManager = (data) => {
 	return request(`/system/salary/`+data, 'DELETE', null, false)
 }


 //设备-考勤机-列表
export const timeDeviceList= (data) =>{
    return request(`/system/device/list`, 'get', data, false)
}

export const getTimeDeviceOne = (data) =>{
    return request(`/system/device/`+data, 'get', null, false)
}

export const addTimeDeviceManager= (data) =>{
    return request(`/system/device`, 'POST', data, false)
}

export const updateTimeDeviceManager= (data) =>{
    return request(`/system/device`, 'PUT', data, false)
}

export const deleteTimeDeviceManager= (data) =>{
    return request(`/system/device/`+data, 'DELETE', null, false)
}
//考勤记录(月份) 根据月份返回天数条记录
export const myTimeDevWorktimelogList = (data) => {
    return request(`/system/worktimelog/list`, 'get', data, false)
}
//考勤统计
export const myTimeDevMonthStatistics = (data) =>{
    return request(`/system/worktimelog/workTimeStatistics`, 'get', data, false)
}
//考勤规则
export const myWorkTime = (data)=>{
    return request(`/system/worktime/`+data, 'get', null, false)
}
//工作日设置
export const daySettingList = (data)=>{
    return request(`/system/workday/setting/list`, 'get', data, false)
}
//工作日设置保存
export const daySettingSave = (data)=>{
    return request(`/system/workday/setting/addSetting`, 'post', data, false)
}
//上下班时间修改保存
export const workTimeUpdate = (data)=>{
    return request(`/system/worktime`,'put',data,false)
}
//人脸录入列表
export const userFaceList = (data)=>{
    return request(`/system/face/list`, 'get', data, false)
}
//人脸新增
export const addUserFace = (data) => {
    return request(`/system/face`, 'POST', data, false)
}
//人脸删除
export const delUserFace = (data) => {
    return request(`/system/face/`+data, 'DELETE', null, false)
}
 // 部门管理 查询
 export const getDeptManager = (data) => {
 	return request(`/system/dept/deptTree`, 'GET', data, false)
 }

 // 部门管理 新增
 export const addDeptManager = (data) => {
 	return request(`/system/dept`, 'POST', data, false)
 }


  // 部门管理 修改
  export const updateDeptManager = (data) => {
  	return request(`/system/dept`, 'PUT', data, false)
  }
 // 部门管理 删除
 export const deleteDeptManager = (data) => {
 	return request(`/system/dept/`+data, 'DELETE', null, false)
 }

 //订单列表
 export const orderPage = (data) =>{
     return request(`/system/order/page`, 'GET', data, false)
 }

 export const getOrderOne = (data) =>{
     return request(`/system/order/`+data, 'GET', null, false)
 }

 //订单新增
 export const createOrder = (data) => {
    return request(`/system/order`, 'POST', data, false)
 }

 //订单编辑
 export const updateOrder = (data) => {
     return request(`/system/order`, 'PUT', data, false)
 }

 //订单删除
 export const deleteOrder = (data) => {
     return request(`/system/order/`+data, 'DELETE', null, false)
 }

 export const getNineSquareGridByOrderId = (data) =>{
    return request(`/system/order/splittingUp/get/`+data, 'GET', null, false)
 }

 export const getOrderDetailById = (data) =>{
     return request(`/system/order/getOrderDetailById/`+data, 'GET', null, false)
 }

 export const getOrderAndSplittInfo = (data) => {
     return request(`/system/order/splittingUp/getOrderAndSplittInfo/`+data, 'GET', null, false)
 }

 export const orderSplittingUpPage = (data) => {
    return request(`/system/order/splittingUp/page`, 'GET', data, false)
 }

 export const orderSplittingUpList = (data) => {
    return request(`/system/order/splittingUp/list`, 'GET', data, false)
 }

 export const addSplittingUp = (data) => {
    return request(`/system/order/splittingUp`, 'POST', data, false);
 }

 export const updateSplittingUp = (data) => {
    return request(`/system/order/splittingUp`, 'PUT', data, false);
 }

 export const addSplittingUpByList = (data) => {
     return request(`/system/order/splittingUp/addByList`, 'POST', data, false);
 }

 export const getOrderPrint = (data) => {
     return request(`/system/order/getOrderPrint/`+data, 'GET', null, false)
 }

 export const getOrderProcessList = (data) =>{
     return request(`/system/order/process/list`, 'GET', data, false)
 }

 export const orderProcessSave = (data) =>{
    return request(`/system/order/process`, 'POST', data, false)
 }

 export const orderProcessUpdate = (data) =>{
    return request(`/system/order/process`, 'PUT', data, false)
 }

 export const orderProcessSaveAndUpdate = (data) =>{
    return request(`/system/order/process/saveAndUpdate`, 'POST', data, false)
 }
 export const getOrderProcessCompleteList = (data) =>{
    return request(`/system/order/process/completeList`, 'GET', data, false)
 }

 // 菜单权限

 export const getRouters = (data) =>{
     return request(`/app/getRouters`, 'GET', data, false)
 }


 export const getOrderProduceDetail = (data) => {
     return request(`/system/order/getOrderProduceDetail/`+data, 'GET', null, false)
 }

 export const getProductionByStyle = (data) => {
    return request(`/system/order/process/productionByStyle`, 'GET', null, false)
 }

 export const getOrderRegisterPage = (data) => {
    return request(`/system/register/page`, 'GET', data, false)
 }

 export const getOrderRegisterList = (data) => {
    return request(`/system/register/list`, 'GET', data, false)
 }

 export const getOrderRegisterListMx = (data) => {
    return request(`/system/register/listMx`, 'GET', data, false)
 }

 export const getOrderRegisterProductionPage = (data) => {
    return request(`/system/register/productionPage`, 'GET', data, false)
 }

 export const getOrderRegisterProcessList = (data) => {
    return request(`/system/register/processList`, 'GET', data, false)
 }

 export const getOrderRegisterProductionOutputList = (data) => {
    return request(`/system/register/productionOutputList`, 'GET', data, false)
 }

 export const getOrderRegisterProductionDateList = (data) => {
    return request(`/system/register/productionDateList`, 'GET', data, false)
 }

export const getOrderRegisterProductionByUserList = (data) => {
    return request(`/system/register/procetionByUserList`, 'GET', data, false)
}

 export const getPieceTotal = (data) => {
    return request(`/system/register/getPieceTotal`, 'GET', data, false)
 }

 export const addOrderRegister = (data) => {
     return request(`/system/register`, 'POST', data, false);
 }

export const delOrderRegister = (data) => {
    return request(`/system/register/`+data, 'DELETE', data, false);
}

export const getBadByBundleCode = (data) => {
    return request(`/system/order/splittingUp/getBadByBundleCode`, 'GET', data, false);
}

export const updateBadfirm = (data) =>{
    return request(`/system/order/splittingUp/updateBadfirm`, 'PUT', data, false)
}

 export const userSalaryByMonthlyPay = (data) => {
     return request(`/system/salary/userSalaryByMonthlyPay`, 'GET', data, false)
 }

 export const userSalaryByPieceworks = (data) => {
    return request(`/system/salary/userSalaryByPieceworks`, 'GET', data, false)
 }

 export const salaryIndex = (data) => {
    return request(`/system/salary/salaryIndex`, 'GET', data, false)
 }

 export const orderIndex = (data) => {
    return request(`/system/order/orderIndex`, 'GET', data, false)
 }
// 新建工厂
 export const addStore = (data) => {
    return request(`/system/store`, 'POST', data, false)
 }
